#ifndef YOOHOO_XMPPCORE_XMPPPARSERFACTORY_H
#define YOOHOO_XMPPCORE_XMPPPARSERFACTORY_H

#include "xmppcore/export.h"
#include "xmppcore/protocolrelations.h"
#include "xmppcore/xmppobject.h"

#include <QtCore/QObject>

namespace yoohoo_xmppcore {

class YOOHOO_XMPPCORE_EXPORT ParsingAttribute {
public:
	ParsingAttribute(QString prefix, QString localName, QString value);
	void setPrefix(QString prefix);
	QString prefix() const;
	void setLocalName(QString localName);
	QString localName() const;
	void setValue(QString value);
	QString value() const;

private:
	QString _prefix;
	QString _localName;
	QString _value;
};

class YOOHOO_XMPPCORE_EXPORT XmppParser {
public:
	~XmppParser();
	virtual XmppObject* obj() = 0;
	virtual bool processAttributes(QString path, QList<ParsingAttribute> attributes);
	virtual bool processText(QString path, QString text);
	virtual bool processEmbeddedObject(ProtocolKey protocolKey, XmppObject* object);
};

class YOOHOO_XMPPCORE_EXPORT XmppParserFactory {
public:
	virtual ProtocolKey protocolKey() = 0;
	virtual XmppParser* createParser() = 0;
};

}

#endif
